package router

import (
	jwt "gitee.com/sansaniot/ssiot-core/httpmvc/jwtauth"
	"github.com/gin-gonic/gin"

	"ssalarm/internal/alarm/apis"
)

func init() {
	RouterCheckRole = append(RouterCheckRole, registerAlarmConfigRouter)
}

func registerAlarmConfigRouter(v1 *gin.RouterGroup, authMiddleware *jwt.GinJWTMiddleware) {
	api := apis.AlarmConfig{}
	// 告警配置
	r := v1.Group("/api/alarm/config").Use(authMiddleware.MiddlewareFuncWithOutValidate())
	{
		r.GET("/find", api.FindAlarmConfig)
		r.GET("/get", api.GetAlarmConfig)
		r.POST("/add", api.UpsertAlarmConfig)
		r.POST("/modify", api.UpsertAlarmConfig)
		r.POST("/remove", api.DeleteAlarmConfig)
	}
}
